﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Xml.Linq;
using System.Linq;

namespace ArmoryBrowser.Entities.Achievements
{
    public class Achievements
    {
        #region Fields
        private Summary _summaryField;
        private Category[] _rootCategoriesField;
        #endregion
        #region Properties
        public Summary Summary
        {
            get
            {
                return this._summaryField;
            }
            set
            {
                this._summaryField = value;
            }
        }
        public Category[] RootCategories
        {
            get
            {
                return this._rootCategoriesField;
            }
            set
            {
                this._rootCategoriesField = value;
            }
        }
        #endregion
        #region Constructor
        public Achievements(XElement element)
        {
            Summary = element.Elements("summary").Select(e => new Summary(e)).FirstOrDefault();
            RootCategories = element.Elements("rootCategories").FirstOrDefault().Elements("category").Select(e => new Category(e)).ToArray();
        }
        #endregion
    }
}
